package com.springboot.cloud.demos.feign.service;

import com.springboot.cloud.common.core.entity.vo.Result;
import com.springboot.cloud.demos.entity.form.UserCouponForm;
import com.springboot.cloud.demos.entity.param.UserCouponQueryParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(name = "ribbon-consumer", fallback = UserCouponServiceFallback.class)
public interface UserCouponService {

    @RequestMapping(value = "/userCoupon/conditions", method = RequestMethod.POST)
    Result conditions(UserCouponQueryParam params);

    @RequestMapping(value = "/userCoupon/{id}", method = RequestMethod.GET)
    Result userCoupon(@PathVariable(value = "id") String id);

    @RequestMapping(value = "/userCoupon", method = RequestMethod.POST)
    Result add(@RequestBody UserCouponForm userCouponForm);

    @RequestMapping(value = "/userCoupon", method = RequestMethod.PUT)
    Result update(@RequestBody UserCouponForm userCouponForm);

    @RequestMapping(value = "/userCoupon/{id}", method = RequestMethod.DELETE)
    void delete(@PathVariable(value = "id") String id);

}
